<include file="Login:header" />
<!--文章列表-->
<div class="subnav">
    <div class="content_menu ib_a blue line_x">
        <a href="{:U('Article/index')}" class="on"><em>文章列表</em></a><span>|</span>
        <a href="{:U('Article/add')}" class=""><em>添加文章</em></a>
    </div>
</div>
<div class="pad_lr_10" >
    <form name="searchform" method="get" >
        <table width="100%" cellspacing="0" class="search_form">
            <tbody>
            <tr>
                <td>
                    <div class="explain_col">
                        创建时间：
                        <input type="text" name="time_start" id="time_start" class="date" size="12" value="{$search.time_start}" readonly>
                        -
                        <input type="text" name="time_end" id="time_end" class="date" size="12" value="{$search.time_end}" readonly>
                        &nbsp;&nbsp;类别：
                        <select name="cate_id" id="article_search_cate_id">
                            <option value="">-所有-</option>
                            <foreach name="all_cate" item="val">
                                <option value="{$val['id']}">{$val['name']}</option>
                            </foreach>
                        </select>
                        &nbsp;&nbsp;状态:
                        <select name="status">
                            <option value="">-所有-</option>
                            <option value="1" <if condition="$search.status eq '1'">selected="selected"</if>>已审核</option>
                            <option value="2" <if condition="$search.status eq '2'">selected="selected"</if>>未审核</option>
                        </select>
                        &nbsp;&nbsp;标题 :
                        <input name="name" type="text" class="input-text" size="25" value="{$search.name}" />
                        <input type="submit" name="search" class="btn" value="搜索" />
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </form>

    <div class="J_tablelist table_list" data-acturi="{:U('article/ajax_edit')}">
        <table width="100%" cellspacing="0">
            <thead>
            <tr>
                <th width=25><input type="checkbox" id="checkall_t" class="J_checkall"></th>
                <th><span data-tdtype="order_by" data-field="id">ID</span></th>
                <th align="left"><span data-tdtype="order_by" data-field="name">文章标题</span></th>
                <th width="80"><span data-tdtype="order_by" data-field="cate_id">类别</span></th>
                <th width=150>作者</th>
                <th width=50><span data-tdtype="order_by" data-field="hits">点击量</span></th>
                <th width=150><span data-tdtype="order_by" data-field="create_time">创建时间</span></th>
                <th width=60><span data-tdtype="order_by" data-field="ordid">排序</span></th>
                <th width="40"><span data-tdtype="order_by" data-field="status">状态</span></th>
                <th width="280">操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="list" id="val" >
                <tr>
                    <td align="center"><input type="checkbox" class="J_checkitem" value="{$val.id}"></td>
                    <td align="center">{$val.id}</td>
                    <td align="left">
                        <span data-tdtype="edit" data-field="name" data-id="{$val.id}" class="tdedit" style="color:{$val.colors};">{$val.name}</span>
                        <notempty name="val['img']">
                            <span class="attachment_icon J_attachment_icon" file-type="image" file-rel="{$img_dir}{$val.img}">
                                <img src="__ROOT__/static/images/filetype/image_s.gif" />
                            </span>
                        </notempty>
                    </td>
                    <td align="center"><b>{$all_cate[$val['cate_id']]['name']}</b></td>
                    <td align="center"><b>{$all_user[$val['user_id']]['user_name']}</b></td>
                    <td align="center"><b>{$val['hits']}</b></td>
                    <td align="center">{:date('Y-m-d H:i:s',$val['create_time'])}</td>
                    <td align="center">
                        <span data-tdtype="edit" data-field="ordid" data-id="{$val.id}" class="tdedit">{$val.ordid}</span>
                    </td>
                    <td align="center">
                        <img data-tdtype="toggle" data-id="{$val.id}" data-field="status" data-value="{$val.status}" src="__ROOT__/static/images/admin/toggle_<if condition="$val.status eq 1">enabled<else/>disabled</if>.gif" />
                    </td>
                    <td align="center">
                        <a target="_blank" href="{:u('Home/index/news', array('id'=>$val['id']))}">打开pc文章</a> |
                        <a target="_blank" href="{:u('Mobile/index/article', array('id'=>$val['id']))}">打开移动文章</a> |
                        <a href="{:u('article/add', array('id'=>$val['id']))}">修改</a> |
                        <a href="javascript:void(0);" class="J_confirmurl" data-acttype="ajax" data-uri="{:U('article/delete', array('id'=>$val['id']))}" data-msg="确认删除 - {$val['name']}">删除</a>
                    </td>
                </tr>
            </volist>
            </tbody>
        </table>
        <if condition="$Think.get.perpage gt 10">
            <div style="height: 60px;"></div>
        </if>
        <div class="btn_wrap_fixed">
            <label class="select_all"><input type="checkbox" name="checkall" class="J_checkall">全选/取消</label>
            <input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('article/delete')}?ok=1" data-name="id" data-msg="确认删除" value="删除" />
            <div id="pages">{$page}</div>
        </div>
    </div>
</div>
<include file="Login:footer" />
<link rel="stylesheet" type="text/css" href="__ROOT__/static/js/calendar/calendar-blue.css"/>
<script src="__ROOT__/static/js/calendar/calendar.js"></script>
<script>
    $('#article_search_cate_id').val('{$search.cate_id}');
    $('.J_cate_select').cate_select({top_option:lang.all});
    Calendar.setup({
        inputField : "time_start",
        ifFormat   : "%Y-%m-%d",
        showsTime  : false,
        timeFormat : "24"
    });
    Calendar.setup({
        inputField : "time_end",
        ifFormat   : "%Y-%m-%d",
        showsTime  : false,
        timeFormat : "24"
    });
</script>
</body>
</html>
